<#include "/include/tag.ftl">
<html lang="en">
<head>
	<title>Share Advance</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<#include "/include/common.ftl">
</head>

<body class="home">
	<#include "/template/header.ftl">
	<div id="content-wrapper">
		<header class="head secondary"></header>
		
		<!-- container -->
		<div class="container">
		
			<ol class="breadcrumb">
				<li><a href="${ctx}/index">首页</a></li>
				<li class="active">登录</li>
			</ol>
		
			<div class="row">
				
				<!-- Article main content -->
				<article class="col-xs-12 maincontent">
					<header class="page-header">
						<h1 class="page-title">登录</h1>
					</header>
					
					<div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
						<div class="panel panel-default">
							<div class="panel-body">
								<h3 class="thin text-center"><span class="glyphicon glyphicon-user"></span>&nbsp;&nbsp;用户登录</h3>
								<hr>
								<form id="login_form" action="${ctx}/login" method="POST">
									<div class="top-margin">
										<label>用户名 / 邮箱地址 <span class="text-danger">*</span></label>
										<input type="text" name="username" class="form-control">
									</div>
									<div class="top-margin">
										<label>密码 <span class="text-danger">*</span></label>
										<input type="password" name="password" class="form-control">
									</div>
									<label class="error">${msg}</label>
									<hr>
		
									<div class="row">
										<div class="col-lg-8">
											<b><a href="">忘记密码?</a>&nbsp;&nbsp;&nbsp;<a href="${ctx}/regist" >注册新账户</a></b>
										</div>
										<div class="col-lg-4 text-right">
											<button class="btn btn-primary" type="submit" id="login_btn">登录</button>
										</div>
									</div>
								</form>
							</div>
						</div>
		
					</div>
					
				</article>
				<!-- /Article -->
		
			</div>
		</div>	<!-- /container -->
	</div>
	<#include "/template/footer.ftl">
</body>
</html>
<script type="text/javascript">
	
	$(function(){
		$("#login_form").validate({
			rules : {
				username : {required : true},
				password : {required : true,minlength : 6}
			},
			messages : {
				username : {required : "用户名不能为空"},
				password : {required : "密码不能为空",minlength:"密码不少于6位"}
			},
		});
		
		$("#login_btn").on("click",function(){
			$("#login_form").submit();
		});
	});
</script>
